package com.nts.bupna.errors;

import javax.tools.Diagnostic;
import javax.tools.JavaFileObject;

public class CompilerError extends BaseError {

    private final Diagnostic<? extends JavaFileObject> diagnostic;

    public CompilerError(final Diagnostic<? extends JavaFileObject> diagnostic) {
        super(diagnostic.toString());
        this.diagnostic = diagnostic;
    }

    public Diagnostic<? extends JavaFileObject> getDiagnostic() {
        return diagnostic;
    }

    @Override
    public String toString() {
        return "CompilerError [message=" + getMessage() + "]";
    }
}
